#include "fxcc/yml/Serializer.h"
#include "fxcc/core/graph/common/AnimTransition.h"

using namespace fxcc::yml;
using namespace fxcc::graph::common;

template<>
void Serializer::Encode<AnimTransition>(YAML::Node& node, const AnimTransition& inst)
{
	Encode<fxcc::Base>(node, inst);
	SetVariable<int>(node, "m_LeftId", inst.m_LeftId);
	SetVariable<int>(node, "m_RightId", inst.m_RightId);
	SetVariable<float>(node, "m_BlendTime", inst.m_BlendTime);
	SetVariable<float>(node, "m_LeftAxis", inst.m_LeftAxis);
	SetVariable<float>(node, "m_RightAxis", inst.m_RightAxis);
	SetVariable<float>(node, "m_TransitionAxis", inst.m_TransitionAxis);
}


template<>
bool Serializer::Decode<AnimTransition>(const YAML::Node& node, AnimTransition& inst)
{
	Decode<fxcc::Base>(node, inst);
	GetVariable<int>(node, "m_LeftId", inst.m_LeftId);
	GetVariable<int>(node, "m_RightId", inst.m_RightId);
	GetVariable<float>(node, "m_BlendTime", inst.m_BlendTime);
	GetVariable<float>(node, "m_LeftAxis", inst.m_LeftAxis);
	GetVariable<float>(node, "m_RightAxis", inst.m_RightAxis);
	GetVariable<float>(node, "m_TransitionAxis", inst.m_TransitionAxis);

	return true;
}
